package com.love.cloud.auth.api;

import com.love.cloud.auth.RemoteAuthProvider;
import com.love.cloud.auth.endpoint.MyTokenEndpoint;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.Map;
import java.util.Set;

/**
 * @author hongdongqu
 */
@DubboService(version = "1.0.0", timeout = 30000)
@Slf4j
public class RemoteAuthServiceProvider implements RemoteAuthProvider {
    @Resource
    private MyTokenEndpoint myTokenEndpoint;

    @Override
    public Object removeTokenByUserName(String userName, Set<String> clientIds) {
        return myTokenEndpoint.removeTokenByUserName(userName,clientIds);
    }

    @Override
    public Object removeToken(String token) {
        return myTokenEndpoint.removeToken(token);
    }

    @Override
    public Object removeAccessToken(String token) {
        return myTokenEndpoint.removeAccessToken(token);
    }

    @Override
    public void removeAllAccessToken() {
        myTokenEndpoint.removeAllAccessToken();
    }

    @Override
    public void setNewUserInfoByToken(String token) {
        myTokenEndpoint.setNewUserInfoByToken(token);
    }

    @Override
    public void setNewUserInfoByUserName(String userName, Set<String> clientIds) {
        myTokenEndpoint.setNewUserInfoByUserName(userName,clientIds);
    }

    @Override
    public Object tokenList(Map<String, Object> params) {
        return myTokenEndpoint.tokenList(params);
    }
}
